package net.tv90.volunteerserveradmin.model.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.tv90.volunteerserveradmin.model.domain.Teacher;
import net.tv90.volunteerserveradmin.model.domain.User;

import java.io.Serializable;
import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class TeacherVO implements Serializable {

    private Long teacherId;
    private String staffNumber;   // 教师工号
    private String name;          // 教师姓名
    private String gender;        // 性别
    private Date dateOfBirth; // 出生日期
    private String department;    // 所属院系
    private String idCardNumber; // 身份证号
    private String position;      // 职位
    private String address;       // 地址
    private String userName;      // 用户名
    private String email;         // 用户邮箱


    // 构造方法，将Teacher和User对象的部分信息合并到VO中
    public TeacherVO(Teacher teacher, User user) {
        this.teacherId = teacher.getId();
        this.staffNumber = teacher.getStaffNumber();
        this.name = teacher.getName();
        this.gender = teacher.getGender();
        this.dateOfBirth = teacher.getDateOfBirth();
        this.department = teacher.getDepartment();
        this.position = teacher.getPosition();
        this.address = teacher.getAddress();
        this.idCardNumber = teacher.getIdCardNumber();
        this.userName = user.getUsername();
        this.email = user.getEmail();
    }
}
